class Solution
{
public:
    int minOperations(vector<string> &logs)
    {
        int step = 0;
        for (string &log : logs)
        {
            if (log == "../")
            {
                --step;
                if (step < 0)
                {
                    step = 0;
                }
            }
            else if (log != "./")
            {
                ++step;
            }
        }
        return step;
    }
};